# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /cvs/zport/sci-mathematics/why/why-2.01.ebuild,v 1.1 2007/04/03 14:56:44 zechs Exp $

inherit eutils

DESCRIPTION="Caml GMP - interfaces of GMP (GNU MP) for OCaml"
HOMEPAGE="http://www-verimag.imag.fr/~monniaux/programmes.html.en"
SRC_URI="http://www-verimag.imag.fr/~monniaux/download/${PN}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="x86"

IUSE=""
DEPEND="
    >=dev-lang/ocaml-3.07
    >=dev-libs/gmp-4.2.2
    <=dev-libs/mpfr-2.4.2_p3
  "

src_unpack() {
	unpack ${A}
}

src_compile() {
	cd ${WORKDIR}/mlgmp/
	sed -i "s/^GMP_INCLUDES.*$/GMP_INCLUDES=-I\/usr\/include/g" Makefile
	sed -i "s/^GMP_LIBDIR.*$/GMP_LIBDIR=\/usr\/lib/g" Makefile
	sed -i "s/mkdir/mkdir -p/g" Makefile
	make || die
}

src_install() {
	local myconf="OCAML_LIBDIR=${D}/usr/lib/ocaml"

	cd ${WORKDIR}/mlgmp/
	make $myconf install || die
}
